﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ForecastPost_List : System.Web.UI.Page
{
    protected List<Model.UsersAccount> userAccount = null;
    protected List<Model.NewsSite> forecastNew = null;
    protected List<Model.ForecastPost> tzlist = null;
    protected decimal winmonenyTotal,jiangjin2 = 0;
    protected List<Model.ForecastPost> forecastShuang,forecastDa, forecast3d, forecastPaiSan, forecastPaiWu, forecastQiXing, forecastQiLe = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int totalCount2 = 0;
            int totalcount = 0;
            forecastNew = BLL.NewsSite.GetPageList_Where(0, 6, 5, out totalcount);
            int totalCount4 = 0;
            tzlist = BLL.ForecastPost.GetPageListBysql(0, 6, "", out totalCount4);
            userAccount = BLL.UsersAccount.getList(0, int.MaxValue, out totalCount2);
            foreach (Model.UsersAccount user in userAccount)
            {
                winmonenyTotal += user.winTotal;
            }
            jiangjin2 = Convert.ToDecimal(winmonenyTotal) / 100000000;
            BindData();
        }
    }
    private void BindData()
    {
        PagedDataSource pds = new PagedDataSource();
        string sqlShuang, sqlDa, sql3d, sqlPaiSan, sqlPaiWu, sqlQiXing, sqlQiLe = "";
        //1；双色球；2；大乐透；3；排列三；4；排列五；5；福彩3D；6；七星彩；7；七乐彩；
        sqlShuang = " and LotteryType=1 ";
        sqlDa = " and LotteryType=2 ";
        sqlPaiSan= " and LotteryType=3 ";
        sqlPaiWu  = " and LotteryType=4 ";
        sql3d = " and LotteryType=5 ";
        sqlQiXing = " and LotteryType=6 ";
        sqlQiLe = " and LotteryType=7 ";
        int totalCount4 = 0;
        forecastShuang = BLL.ForecastPost.GetPageListBysql(0, 10, sqlShuang, out totalCount4);
        forecastDa = BLL.ForecastPost.GetPageListBysql(0, 10, sqlDa, out totalCount4);
        forecastPaiSan = BLL.ForecastPost.GetPageListBysql(0, 10, sqlPaiSan, out totalCount4);
        forecastPaiWu = BLL.ForecastPost.GetPageListBysql(0, 10, sqlPaiWu, out totalCount4);
        forecast3d = BLL.ForecastPost.GetPageListBysql(0, 10, sql3d, out totalCount4);
        forecastQiXing = BLL.ForecastPost.GetPageListBysql(0, 10, sqlQiXing, out totalCount4);
        forecastQiLe = BLL.ForecastPost.GetPageListBysql(0, 10, sqlQiLe, out totalCount4);
        //forecastNew = BLL.ForecastPost.GetPageListBysql(0, 5, "", out totalCount4);
    }
    public string SelectName(object Uid)
    {
        Model.CMember cm = BLL.CMember.GetModel(Convert.ToInt32(Uid));
        if (cm != null)
        {
            return cm.nickname;//用户真实姓名
        }
        else
        {
            return "***";
        }
    }
}